package com.atguigu.edu.app.func;

import com.atguigu.edu.util.IkUtil;
import org.apache.flink.table.annotation.DataTypeHint;
import org.apache.flink.table.annotation.FunctionHint;
import org.apache.flink.table.functions.TableFunction;
import org.apache.flink.types.Row;

import java.util.List;

@FunctionHint(output = @DataTypeHint("row<kw string>"))
public class IkAnalyzer extends TableFunction<Row> {

    public void eval(String keyword){
        List<String> split = IkUtil.split(keyword, true);
        for (String s : split) {
            collect(Row.of(s));
        }
    }
}
